package pers.ljf.escloud.service.modules.app.impl;

import com.google.gson.Gson;
import org.springframework.stereotype.Service;
import pers.ljf.escloud.dao.entity.DriveConfig;
import pers.ljf.escloud.service.modules.app.DriveConfigService;

import java.util.ArrayList;
import java.util.List;

@Service
public class DriveConfigServiceImpl implements DriveConfigService {
    @Override
    public List<DriveConfig> listOnlyEnable() {
        List<DriveConfig> configs = new ArrayList<>();
        String configJson = "{\n" +
                "  \"id\": 1,\n" +
                "  \"enable\": true,\n" +
                "  \"name\": \"演示\",\n" +
                "  \"enableCache\": false,\n" +
                "  \"autoRefreshCache\": false,\n" +
                "  \"type\": {\n" +
                "    \"key\": \"upyun\",\n" +
                "    \"description\": \"又拍云 USS\"\n" +
                "  },\n" +
                "  \"searchEnable\": false,\n" +
                "  \"searchIgnoreCase\": false,\n" +
                "  \"searchContainEncryptedFile\": false,\n" +
                "  \"orderNum\": null,\n" +
                "  \"defaultSwitchToImgMode\": false\n" +
                "}";
        DriveConfig config = new Gson().fromJson(configJson, DriveConfig.class);
        configs.add(config);
        return configs;
    }
}
